<template>


    <a-modal :title="editRecord.nickname+'备注设置'" :width="600" :destroyOnClose="true" :maskClosable="false"
             :visible="visible" @cancel="handleCancel"
             @ok="onsubmit"
    >

        <a-input placeholder="请设置用户备注名 30个字符以内" allow-clear v-model="editRecord.remark"/>
    </a-modal>

</template>
<script>
    import {userUpdate} from '../public/http';

    export default {

        props: ["editRecord"],
        data() {
            return {
                loading: false, //按钮Loading
                visible: true, //modal 显示状态

            };
        },
        methods: {
            onsubmit() {
                userUpdate(this.editRecord.id, this.editRecord).then(res => {
                    this.$exMod.ajaxMessage(res);
                    if(res.code===0){
                        this.visible = false;
                        this.$emit('closeModal', {render: true});
                    }

                })


            },

            //关闭弹窗
            handleCancel() {
                this.visible = false;
                this.$emit('closeModal', {
                    render: false
                });
            },


        },


    };
</script>
